#ifndef MOUSEWIDGET_H
#define MOUSEWIDGET_H

#include <ctime>

#include <qpoint.h>
#include <qwidget.h>

class QMouseEvent;
class Config;

class MouseWidget: public QWidget
{
	Q_OBJECT
	
signals:
	void mouseMovedAbsolute(unsigned short, unsigned short);
	void mouseMovedRelative(signed char, signed char);
	
	void mouseLeftButtonClicked();
	void mouseRightButtonClicked();
	
public:
	MouseWidget(Config *, QWidget *parent = NULL);
	// virtual ~MouseWidget();
	
protected:
/*
	void keyPressEvent(QKeyEvent *);
	void keyReleaseEvent(QKeyEvent *);
*/
	
	void mousePressEvent(QMouseEvent *);
	void mouseReleaseEvent(QMouseEvent *);
	void mouseMoveEvent(QMouseEvent *);
	
private:
	QPoint prevPoint;
	QPoint startPoint;
	time_t startTime;
	Config *config;
};

#endif	// MOUSEWIDGET_H
